//
//  LBCityModel.m
//  UISearchViewController
//
//  Created by LINAICAI on 2017/1/12.
//  Copyright © 2017年 LINAICAI. All rights reserved.
//

#import "LBCityModel.h"

@implementation LBCityModel
//设置城市名称
- (void)setAreaName:(NSString *)areaName{
    _areaName = areaName;
    //设置拼音
    _areaLetter = [self pingYinWithAreaName:areaName];
    //设置key
    _areaKey = [[_areaLetter substringToIndex:1] uppercaseString];
}
- (NSString *)pingYinWithAreaName:(NSString *)areaName{
    //城市名转换为拼音
    NSMutableString *ms = [[NSMutableString alloc] initWithString:areaName];
    if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformMandarinLatin, NO)){
        
    }
    if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransformStripDiacritics, NO)){
    }
    return ms.mutableCopy;
}
@end
